using System;
using System.Collections.Generic;
using System.Text;

namespace Adoor.Collections.Generic
{
    public delegate void DictionaryChangeEventHandler<TKey, TVakue>(object sender, DictionaryChangeEventArgs<TKey, TVakue> e);

    public class DictionaryChangeEventArgs<TKey, TVakue> : EventArgs
    {
        // Summary:
        //     Initializes a new instance of the System.ComponentModel.DictionaryChangeEventArgs
        //     class.
        //
        // Parameters:
        //   element:
        //     An System.Object that specifies the instance of the Dictionary where the
        //     change occurred.
        //
        //   action:
        //     One of the System.ComponentModel.DictionaryChangeAction values that specifies
        //     how the Dictionary changed.
        public DictionaryChangeEventArgs(DictionaryChangeAction action, TKey key, TVakue value)
        {
            this.action = action;
            this.key = key;
            this.value = value;
        }

        private DictionaryChangeAction action;

        // Summary:
        //     Gets an action that specifies how the Dictionary changed.
        //
        // Returns:
        //     One of the System.ComponentModel.DictionaryChangeAction values.
        public virtual DictionaryChangeAction Action { get { return action; } }

        private TKey key;

        public virtual TKey Key { get { return key; } }

        private TVakue value;

        public virtual TVakue Value { get { return value; } }
    }

    // Summary:
    //     Specifies how the Dictionary is changed.
    public enum DictionaryChangeAction
    {
        // Summary:
        //     Specifies that an element was added to the Dictionary.
        Add = 1,
        //
        // Summary:
        //     Specifies that an element was removed from the Dictionary.
        Remove = 2,
        //
        // Summary:
        //     Specifies that the entire Dictionary has changed. This is caused by using
        //     methods that manipulate the entire Dictionary, such as System.Dictionarys.DictionaryBase.Clear().
        Refresh = 3,
    }
}
